<?PHP

	class tpl_managefilter {
		
		public static function managefilter(){
			
			$filters = '';
			$class = 'td2';
			foreach($GLOBALS['OUTPUT']->filters as $w=>$r){
				$link = base64_encode($w);
				
				$filters .= <<<EOV
<tr>
	<td class='$class' width='40%'>$w</td>
	<td class='$class' width='40%'>$r</td>
	<td class='$class' width='20%'><a href='./index.php?act=admin&page=managefilter{$GLOBALS['OUTPUT']->ses}&delete=$link'>[{$GLOBALS['LANG']->lang_admin->delete}]</a></td>
</tr>
EOV;
				$class = ($class == 'td2' ? 'td1' : 'td2');
			}
			
			if(empty($filters)){
				$filters = <<<EOV
<tr>
	<td class='td2' colspan='3' style='text-align: center; font-style: italic'>{$GLOBALS['LANG']->lang_admin->no_filters_found}</td>
</tr>
EOV;
			}
			
			return	tpl_globals::header() .
				<<<EOV
<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=managefilter' method='post'>
	<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->managefilter}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
		<tr>
			<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->word}</td>
			<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->replacement}</td>
			<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_admin->action}</td>
		</tr>
		{$filters}
	</table>
	
	<br />
	
	<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->addfilter}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
		<tr>
			<td class='td2'>
				{$GLOBALS['LANG']->lang_admin->word}
			</td>
			<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','word') .
				<<<EOV
			</td>
		</tr>
		<tr>
			<td class='td2'>
				{$GLOBALS['LANG']->lang_admin->replacement}
			</td>
			<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','replacement') .
				<<<EOV
			</td>
		</tr>
		<tr>
			<td class='table_header_row' colspan='2' style='text-align: center'><input class='form_button_norm' onmouseout="this.className=this.className.replace('_over','_norm');" onmouseover="this.className=this.className.replace('_norm','_over');" type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' /></td>
		</tr>
	</table>
</form>
EOV
.
			tpl_globals::footer();
				
		}
		
	}

?>